/*
 * Material.cpp
 *
 *  Created on: May 27, 2011
 *      Author: Ernest Mashele <mashern@gmail.com>
 */

#include "Material.h"

Material::Material()
{
    ambientColour = D3DXVECTOR4(0.15f, 0.15f, 0.15f, 0.15f);
    specularColour = D3DXVECTOR4(1.0f, 1.0f, 1.0f, 1.0f);
    diffuseColour = D3DXVECTOR4(1.0f, 1.0f, 1.0f, 1.0f);
    alpha = 1.0f;
    specularPower = 32.0f;
    ZeroMemory(diffuseMap, MAX_PATH);
}

Material::~Material()
{

}

FLOAT Material::getAlpha() const
{
	return alpha;
}

D3DXVECTOR4 Material::getAmbientColour() const
{
	return ambientColour;
}

D3DXVECTOR4 Material::getDiffuseColour() const
{
	return diffuseColour;
}

void Material::getDiffuseMap(WCHAR *diffuseMap) const
{
	ZeroMemory(diffuseMap, MAX_PATH);
	wcscpy_s(diffuseMap, MAX_PATH - 1, this->diffuseMap);
}

D3DXVECTOR4 Material::getSpecularColour() const
{
	return specularColour;
}

FLOAT Material::getSpecularPower() const
{
	return specularPower;
}

void Material::setAlpha(FLOAT alpha)
{
	this->alpha = alpha;
}

void Material::setAmbientColour(D3DXVECTOR4 ambientColour)
{
	this->ambientColour = ambientColour;
}

void Material::setDiffuseColour(D3DXVECTOR4 diffuseColour)
{
	this->diffuseColour = diffuseColour;
}

void Material::setDiffuseMap(WCHAR *diffuseMap)
{
    ZeroMemory(this->diffuseMap, MAX_PATH);
    wcscpy_s(this->diffuseMap, MAX_PATH - 1, diffuseMap);
}

void Material::setSpecularColour(D3DXVECTOR4 specularColour)
{
	this->specularColour = specularColour;
}

void Material::setSpecularPower(FLOAT specularPower)
{
	this->specularPower = specularPower;
}

